﻿@using Mulala.Cavan.Presentation.Mvc.Controller
@model Mulala.Cavan.Presentation.Mvc.ViewModel.INannyViewModel
@{
    ViewBag.Title = "个人中心";
    Layout = "~/Views/Shared/_NannyCenterLayout.cshtml";
}
@section header{
    <title>@ViewBag.Title</title>
    @Styles.Render("~/Content/themes/corporationcenter")
    @Styles.Render("~/Content/themes/corporationcenter/index")
}
<div id="main">
    <div id="maintoptext">
        &nbsp;&nbsp;欢迎，@Model.Item.Name！<br />
        <span style="padding-left: 30px;">你已竞标@{ @Model.BiddedConsignCount.ToString() }个委托，总共有点@{ @Model.BiddedSuccessConsignCount.ToString() }个竞标成功</span>
        @{
            if (@Model.Item.IsWorking)
            {
            <input type="button" value=" " id="setnowork" class="wygz" />  
            <input type="button" value=" " id="setwork" class="wygz" style="display: none" />
            }
            else
            {
            <input type="button" value=" " id="setnowork" class="wygz" style="display: none" />  
            <input type="button" value=" " id="setwork" class="wygz" />
            }
        }
        &nbsp;&nbsp;
        <input type="submit" name="button" id="refresh" value=" " class="suaxing" />
        <span style="padding-left: 45px;">客服QQ：258190958</span>
    </div>
    @Html.Partial("_nannyToolPartial")
    <div id="divtab">
        <div id="divtop">
            &nbsp;&nbsp;&nbsp;&nbsp;最新竞标</div>
        @{
            Html.RenderAction(ActionConst.NANNYRECENTBIDDINGCONSIGN, ControllerConst.CONSIGN);
        }
        <div id="divtop">
            &nbsp;&nbsp;&nbsp;&nbsp;谁看过我</div>
        @{
            Html.RenderAction(ActionConst.RECENTVISITOR, ControllerConst.VISITHISTORY, new { id = @Model.MasterModel.CurrentUserModel.UserAccountID });
        }
    </div>
    <div id="divsystem">
        &nbsp;&nbsp;&nbsp;&nbsp;系统公告</div>
    @{
        Html.RenderAction(ActionConst.RECENTNOTICE, ControllerConst.NOTICE);
    }
</div>
<div id="rights">
    <div id="righttop">
        @Html.Partial("_nannyAccessPartial", @Model)
    </div>
    <div id="divs1">
        @{
            Html.RenderAction(ActionConst.RECOMMENDCONSIGN, ControllerConst.CONSIGN);
        }
    </div>
    <div id="divs2">
        @{
            Html.RenderAction(ActionConst.POPULARPROPRIETOR, ControllerConst.PROPRIETOR);
        }
    </div>
    <div id="righttop" class="rightbomt" style="margin-top: 10px;">
        @{
            @Html.Partial("~/Views/CorporationCenter/_corporationCenterHelpPartial.cshtml");
        }
    </div>
</div>
<script type="text/javascript">
    $(function () {
        $("#refresh").click(function () {
            $.ajax({
                url: '/nannycenter/refresh',
                type: 'POST',
                success: function (data) {
                    if (data) {
                        if (data.IsSuccess) {
                            alert(data.Messages[0]);
                        }
                    }
                },
                error: function () {
                }
            });
        });

        $("#setwork").click(function () {
            $.ajax({
                url: '/nannycenter/setwork',
                type: 'POST',
                success: function (data) {
                    if (data) {
                        if (data.IsSuccess) {
                            $("#setwork").hide();
                            $("#setnowork").show();
                        }
                    }
                },
                error: function () {
                }
            });
        });

        $("#setnowork").click(function () {
            $.ajax({
                url: '/nannycenter/setnowork',
                type: 'POST',
                success: function (data) {
                    if (data) {
                        if (data.IsSuccess) {
                            $("#setnowork").hide();
                            $("#setwork").show();
                        }
                    }
                },
                error: function () {
                }
            });
        });
    })
</script>
